package com.sdhs.system.syncdata.common;

import lombok.Getter;

/**
 * @author zhangmy
 * @date 2022/9/2014:10
 * @Description:属性值字段是否必填
 */
public enum UserRequiredEnum {
    ID("userId", true),
    USERNAME("userName", true),
//    PASSWORD("password", true),
    REALNAME("nickName", true),
//    TYPE("type", false),
//    HEADURL("headUrl", false),
//    GENDER("gender", false),
    EMAIL("email", false),
    MOBILE("phonenumber", true),
//    MOBILE2("mobile2", true),
//    POSITIONDESC("positionDesc", false),
//    SUPERADMIN("superAdmin", false),
//    HASADMIN("hasAdmin", false),
//    DATASCOPETYPE("dataScopeType", false),
    DEPTID("deptId", true),

//    COMPANYID("companyId", true),
    STATUS("status", false);
//    ROLEIDS("roleIds", false);
//    ORDERID("orderId", false);




    @Getter
    final String fieldName;
    @Getter
    final boolean required;

    UserRequiredEnum(String fieldName, boolean required) {
        this.fieldName = fieldName;
        this.required = required;
    }

    public static String getValue(String name) {
        UserRequiredEnum[] reEnum = values();
        for (UserRequiredEnum type : reEnum) {
            if (name.equals(type.fieldName)) {
                return String.valueOf(type.required);
            }
        }
        return null;
    }
}
